<script setup>
import {ref ,watch} from "vue";

let rs=ref("")
watch(rs,(newVal,oldVal)=>{
  console.log(`这是新的${newVal},这是旧的${oldVal}`)
  if (newVal==="123"){
    alert("123")
  }

})
</script>
<template>
<div>
  <input type="text" value="缓缓飘下的落叶" v-model="rs">
</div>
</template>